/*
 * @Author: bankeyu-dell 573569790@qq.com
 * @Date: 2022-10-08 15:53:59
 * @LastEditors: bankeyu-dell 573569790@qq.com
 * @LastEditTime: 2022-10-13 00:43:12
 * @FilePath: \fast-vue3\src\api\life\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { get, post } from '/@/utils/http/axios';
enum URL {
  addcomments = '/msvc/addcomments', // 新增评论接口
  addlife = '/msvc/addlife', // 新增生活接口
  delcomments = '/msvc/delcomments', // 删除评论接口
  forwordlife = '/msvc/forwordlife', // 转发生活接口
  lifecomments = '/msvc/lifecomments', // 查看生活评论列表接口
  lifedel = '/msvc/lifedel', // 删除生活详情接口
  lifedetail = '/msvc/lifedetail', // 查看生活详情接口
  lifelist = '/msvc/lifelist', // 查看生活列表接口
  thumbsup = '/msvc/thumbsup', // 生活点赞接口
  location = '/msvc/location', // 范围接口
}

export interface AddcommentsData {
  lifeId: number;
  parentId: number;
  contents: string;
  random: string;
  respondents: number;
  respondentsName: string;
  timestamp: string;
}

export interface AddlifeData {
  address: string;
  city: string;
  contents: string;
  county: string;
  customerId: number;
  fileUrl: string[];
  lables: number[];
  limitCustomers: number[];
  limitFlag: string;
  province: string;
  random: string;
  timestamp: string;
}

export interface IdData {
  id: number;
}

export interface LifecommentsData {
  lifeId: number;
  pageNo: number;
  pageSize: number;
  random: string;
  timestamp: string;
}

export interface LifelistData {
  contents: string;
  customerId: number;
  pageNo: number;
  pageSize: number;
  random: string;
  timestamp: string;
}

export interface LocationData {
  appVersion: string;
  birthday: string;
  city: string;
  county: string;
  customerId: number;
  gender: string;
  latitude: number;
  longitude: number;
  province: string;
}

const addcomments = async (data: AddcommentsData) => post<any>({ url: URL.addcomments, data });
const addlife = async (data: AddlifeData) => get<any>({ url: URL.addlife, data });
const delcomments = async (data: IdData) => post<any>({ url: URL.delcomments, data });
const forwordlife = async (data: IdData) => get<any>({ url: URL.forwordlife, data });
const lifecomments = async (data: LifecommentsData) => post<any>({ url: URL.lifecomments, data });
const lifedel = async (data: IdData) => post<any>({ url: URL.lifedel, data });
const lifedetail = async (data: IdData) => get<any>({ url: URL.lifedetail, data });
const lifelist = async (data: LifelistData) => post<any>({ url: URL.lifelist, data });
const thumbsup = async (data: IdData) => post<any>({ url: URL.thumbsup, data });
const location = async (data: LocationData) => post<any>({ url: URL.location, data });
export { addcomments, addlife, delcomments, forwordlife, lifecomments, lifedel, lifedetail, lifelist, thumbsup, location };
